This R21/R33 grant will design and build a neural imager/stimulator which will integrate EEG, TMS and fMRI into a single instrument in the R21 phase. This will enable EEG and fMRI to be acquired simultaneously in conjunction with the application of TMS pulses. This instrument will test the hypothesis that TMS pulses applied in synchrony with the brain's internal rhythms will have greater local and distributed effects than will non-synchronized stimulation and specifically whether knowing and understanding the brain's rhythms and stimulating with this knowledge will have larger brain effects than the current state of the art, where stimulation is largely done without knowledge of internal brain state. The R21 phase will test these in normal subjects after the full real-time feedback system is developed. In the R33 phase we will test whether synchronized TMS will be a successful treatment in a high percentage of drug resistant depressed patients, and will result in better clinical outcomes than will non-synchronized stimulation, which is currently employed. The detailed Specific Aims to accomplish these goals are: R21 phase Specific Aim1: Integrate an EEG system with our existing simultaneous TMS and fMRI scanner so the final instrument is able to acquire and conduct simultaneous EEG-fMRI-TMS measurements. Specific Aim2: Develop the necessary software and interface hardware to detect and use in real-time the alpha phase and/or frequency to provide real-time closed loop control of the TMS pulse timing. Specific Aim 3: Show in a cohort of normal subjects that there is significant variation of rACC inhibition as the timing of TMS pulses applied to the DLPFC are varied with respect to the phase and frequency of an individual's alpha rhythms. R33 phase Specific Aim 1: Integrate a similar EEG system with our treatment TMS scanner with similar feedback circuitry as that in SA 3 in the R21. Specific Aim 2: Carry out a 4 week trial of anti-depressive therapy randomized between optimum timed TMS and standardized non-synchronous TMS in a cohort of depressed patients to estimate the success rate of such an optimized treatment.